package com.net.shop.car.manager.ui.personalcenter.dingdan;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

import com.net.shop.car.manager.R;
import com.net.shop.car.manager.api.model.Dingdan;

public class FinishDingdanItem implements ExpandHolder {

	private ImageView btn;
	private TextView leftTxt;
	private TextView rightTxt;
	
	public FinishDingdanItem(View view) {
		leftTxt = (TextView) view
				.findViewById(R.id.dingdan_finish_item_lefttxt);
		rightTxt = (TextView) view
				.findViewById(R.id.dingdan_finish_item_righttxt);
		btn = (ImageView) view.findViewById(R.id.dingdan_finish_item_btn);
	}

	@Override
	public void setOnExpandedListener(OnClickListener onClickListener) {
		btn.setOnClickListener(onClickListener);
	}
	
	public void setData(Dingdan dingdan,boolean isOpened) {
		setBtnState(isOpened);
		leftTxt.setText(dingdan.getGoodName());
		rightTxt.setText(dingdan.getGoodPrice().toString() + "元");
	}
	/**
	 * @param closed
	 */
	public void setBtnState(boolean open) {
		btn.setSelected(open);
	}

}
